#include <iostream>
#include <string>
#include <memory>

class PaymentMethod {
public:
    virtual ~PaymentMethod() {}
    virtual void processPayment(double amount) = 0;
};

class CreditCardPayment : public PaymentMethod {
public:
    void processPayment(double amount) override {
        std::cout << "Processing credit card payment of $" << amount << std::endl;
    }
};

class PayPalPayment : public PaymentMethod {
public:
    void processPayment(double amount) override {
        std::cout << "Processing PayPal payment of $" << amount << std::endl;
    }
};

class PaymentProcessor {
public:
    void processPayment(PaymentMethod* method, double amount) {
        method->processPayment(amount);
    }
};

int main() {
    CreditCardPayment creditCard;
    PayPalPayment payPal;

    PaymentProcessor processor;
    processor.processPayment(&creditCard, 100.0);
    processor.processPayment(&payPal, 200.0);

    return 0;
}